package com.tn.service.map;

import com.tn.controller.alarm.common.model.external.subsystem.vo.ExitPermitVO;
import com.tn.controller.alarm.common.model.external.subsystem.vo.WeighInstructionsVO;
import com.tn.controller.alarm.common.model.map.TruckInfoVO;
import com.tn.controller.alarm.common.model.map.TruckTrailVO;
import com.tn.controller.alarm.common.model.map.VehicleInfoVO;
import com.tn.controller.alarm.common.model.map.WarningVO;
import com.tn.exception.DatabaseOperationFailedException;
import org.eclipse.paho.client.mqttv3.MqttException;

/**
 * 地图Service
 *
 * @program: tn_aucy_java
 * @author: yangjiayao
 * @create: 2022/1/4
 */
public interface IMapService {
    /**
     * 查询货车信息
     *
     * @param tagId 标签ID
     * @return 货车信息
     * @throws DatabaseOperationFailedException 数据库异常
     */
    TruckInfoVO queryTruckInfo(String tagId) throws DatabaseOperationFailedException;

    /**
     * 查询货车历史轨迹
     *
     * @param tagId   标签ID
     * @param truckId 车辆ID
     * @return 历史轨迹信息
     * @throws DatabaseOperationFailedException 数据库异常
     */
    TruckTrailVO queryTruckTrail(String tagId, Integer truckId) throws DatabaseOperationFailedException;

    /**
     * 查询装载车信息
     *
     * @param tagId 标签ID
     * @return 装载车信息
     * @throws DatabaseOperationFailedException 数据库异常
     */
    VehicleInfoVO queryVehicleInfo(String tagId, String position) throws DatabaseOperationFailedException;

    /**
     * 发送告警信息到MQTT
     *
     * @param warningVO 告警信息
     * @throws MqttException MQTT异常
     */
    void sendWarningToMap(WarningVO warningVO);

    /**
     * 发送闸口标签到MQTT
     *
     * @param gateInfo 闸口信息
     * @throws MqttException MQTT异常
     */
    void sendGateTagToMap(ExitPermitVO gateInfo) throws MqttException;

    /**
     * 发送磅房标签到MQTT
     *
     * @param weightInfo 磅房标签
     * @throws MqttException MQTT异常
     */
    void sendWeightTagToMap(WeighInstructionsVO weightInfo) throws MqttException;
}
